// Author: Ivan Kazmenko (gassa@mail.ru)
// Validator for problem "triangle"
module validate;
import std.exception;
import std.math;
import testlib;

immutable int minN =   1;
immutable int maxN = 100;
immutable int maxC = 100;

struct Point
{
	int x;
	int y;

	bool isValid () const
	{
		return abs (x) <= maxC && abs (y) <= maxC;
	}
}

int vp () (const auto ref Point a,
    const auto ref Point b, const auto ref Point c)
{
	return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}

void main (string [] args)
{
	initTestlib !(TestlibRole.validator) (args);

	auto n = inFile.read !(int) (minN, maxN);
	inFile.skip ("\n");
	foreach (i; 0..n)
	{
		Point a, b, c, p, q;

		a.x = inFile.read !(int) (-maxC, +maxC);
		inFile.skip (" ");
		a.y = inFile.read !(int) (-maxC, +maxC);
		inFile.skip ("  ");
		enforce (a.x < 0);

		b.x = inFile.read !(int) (-maxC, +maxC);
		inFile.skip (" ");
		b.y = inFile.read !(int) (-maxC, +maxC);
		inFile.skip ("  ");
		enforce (b.x < 0);

		c.x = inFile.read !(int) (-maxC, +maxC);
		inFile.skip (" ");
		c.y = inFile.read !(int) (-maxC, +maxC);
		inFile.skip ("  ");
		enforce (c.x < 0);

		enforce (vp (a, b, c) != 0);

		p.x = inFile.read !(int) (-maxC, +maxC);
		inFile.skip (" ");
		p.y = inFile.read !(int) (-maxC, +maxC);
		inFile.skip ("  ");
		enforce (p.x > 0);

		q.x = inFile.read !(int) (-maxC, +maxC);
		inFile.skip (" ");
		q.y = inFile.read !(int) (-maxC, +maxC);
		inFile.skip ("\n");
		enforce (q.x > 0);

		enforce (p != q);
	}

	inFile.checkEof ();
}
